<script id="namespace_view-container-template" type="text/x-handlebars-template">
    <div id="table-view">
        <div class="operations">
            <div class="dropdown">
                <button class="btn dropdown-toggle" data-toggle="dropdown">Operations</button>
                <ul class="dropdown-menu">
                    <li><a href="#" class="rename">Rename table</a></li>
                    <li><a href="#" class="delete">Delete table</a></li> 
                </ul>
            </div>
        </div>
        <div class="main_title"></div>
        <div id="user-alert-space"></div>
        <div class="section statistics">
            <h2 class="title">Statistics</h3>
            <div class="content row-fluid">
                <div class="span4 profile"></div>
                <div class="span8 performance-graph"></div>
            </div>
        </div>

        <div class="row">
            <div class="span5">
                <div class="section sharding"></div>
            </div>
            <div class="span7">
                <div class="section replication"></div>
                <div class="section secondary_indexes"></div>
            </div>
        </div>
        <div class="section server-assignments tree-view"></div>
    </div>
</script>

<script id="namespace_view_title-template" type="text/x-handlebars-template">
    <h1 class="title">Table overview for {{name}}</h1>
</script>

<script id="namespace_view-profile-template" type="text/x-handlebars-template">
    <div class="summary">
        <div class="stat-row first">
            <p class="availability"><span class="big">{{humanize_namespace_reachability reachability}}</span></p>
        </div>
        <div class="stat-row">
            {{#if total_keys_available}}
            <p class="documents"><span class="big">About {{total_keys}} </span>documents</p>
            {{else}}
            <p class="documents"><span class="big">N/A </span>documents</p>
            {{/if}}
        </div>
        <div class="stat-row">
            <p class="masters"><span class="big">{{nashards}}/{{nshards}} </span> masters reachable</p>
        </div>
        <div class="stat-row">
            <p class="replicas"><span class="big">{{nareplicas}}/{{nreplicas}} </span> replicas reachable</p>
        </div>
    </div>
</script>


<script id="namespace_view-secondary_indexes-template" type="text/x-handlebars-template">
    <h2 class="title">Secondary indexes</h2>
    <div class="alert main_alert">
        <a class="close_hide" href="#">&times;</a>
        <div class="alert_content"></div>
    </div>
    <div class="alert alert-error main_alert_error">
        <a class="close_hide" href="#">&times;</a>
        <div class="alert_error_content"></div>
    </div>
    <div class="alert alert-error"></div>
    <div class="content">
        {{#if loading}}
        <p>Loading...</p>
        {{else}}
        <ul class="list_secondary_indexes">
            <li class="square_li no_index">No secondary indexes found.</li>

            <li class="square_li input_li add_index_li"><input type="text" class="new_index_name" placeholder="name of the key" /><button class="btn cancel_btn">Cancel</button><button class="btn create_btn">Create</button></li>
        </ul>
        <div class="create_container"><a href="#" class="create_link">Create a new secondary index &rarr;</a></div>
        {{/if}}
    </div>
</script>

<script id="namespace_view-secondary_indexes-content-template" type="text/x-handlebars-template">
    {{#if error}}
        <div class="alert alert-error displayed_alert">
        </div>
    {{/if}}
</script>

<script id="namespace_view-secondary_index-template" type="text/x-handlebars-template">
    <div class="square_li"><span class="name">{{#if is_empty}}<em>[empty string]</em>{{else}}{{name}}{{/if}}</span> — <a href="#" data-name="{{name}}" class="delete_link">delete</a></div>
    <div class="progress_li">
        {{#if ready}}Ready to use{{else}}building{{/if}} 
    </div>
    <div class="alert_li">
        <div class="alert alert_confirm_delete">
            <div class="content">
                Are you sure you want to delete the secondary index {{#if is_empty}}<em>[empty string]</em>{{else}}<strong>{{name}}</strong>{{/if}}?<br/>
                <button class="btn cancel_delete_btn">Cancel</button><button class="btn delete_index_btn">Delete</button>
            </div>
        </div>
    </div>
</script>

<script id="secondary_indexes-alert_msg-template" type="text/x-handlebars-template">
    {{#if delete_ok}}
    <p>You successfully deleted the secondary index <strong>{{name}}</strong>.</p>
    {{/if}}
    {{#if create_ok}}
    <p>You successfully created the secondary index <strong>{{name}}</strong>.</p>
    {{/if}}
</script>

<script id="secondary_indexes-error-template" type="text/x-handlebars-template">
    {{#if connect_fail}}
    <p>An error occured: Could not open a connection. <a href="#" class="reconnect_link">Try again</a>.</p>
    {{/if}}
    {{#if index_list_fail}}
    <p>An error occurred: could not retrieve secondary indexes. <a href="#" class="reconnect_link">Try again</a>.</p>
    {{/if}}
    {{#if create_fail}}
    <p>The secondary index could not be created:</p>
    <div class="error_detail">
        {{print_safe message}}
    </div>
    {{/if}}
    {{#if delete_fail}}
    <p>The secondary index could not be deleted:</p>
    <div class="error_detail">
        {{print_safe message}}
    </div>
    {{/if}}
</script>
